﻿/*
 * @autor: hectorea
 * @date: 11/08/2012
 * @programming interview 5
 * 
 */

using System;

namespace IsAnagram
{
    /// <summary>
    /// Programming Interview 5: Write a method to verify if two strings are an anagram.
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            string input1 = string.Empty;
            string input2 = string.Empty;

            do
            {
                Console.Clear();

                Console.Write("Type a string:");
                input1 = Console.ReadLine();

                Console.WriteLine();

                Console.Write("Type a string:");
                input2 = Console.ReadLine();

                Console.WriteLine("The strings {0} and {1} ara anagrams? {2}", input1, input2, input1.IsAnagram(input2) ? "YES" : "NO");

                Console.Write("Please type any key to continue o [X] to exit: ");
                input1 = Console.ReadLine().ToUpper();

            } while (input1 != "X");
        }
    }
}
